﻿using System;

namespace Arborium
{
    #region Event types

    public class ArboriumEventArgs : EventArgs
    {
    }

    #region Load event arguments

    public class ArboriumLoadEventArg : ArboriumEventArgs
    {
    }

    public class ArboriumLoadingEventArgs : ArboriumLoadEventArg
    {
    }

    public class ArboriumLoadedEventArgs : ArboriumLoadEventArg
    {
    }

    #endregion

    #region Save event arguments

    public class ArboriumSaveEventArg : ArboriumEventArgs
    {
    }

    public class ArboriumSavingEventArgs : ArboriumSaveEventArg
    {
    }

    public class ArboriumSavedEventArgs : ArboriumSaveEventArg
    {
    }

    #endregion

    #endregion

    #region Handlers and events

    public partial class AElement
    {
        #region Handlers

        public delegate void DataLoadingEventHandler(AElement source, ArboriumLoadingEventArgs args);
        public delegate void DataLoadedEventHandler(AElement source, ArboriumLoadedEventArgs args);
        public delegate void DataSavingEventHandler(AElement source, ArboriumSavingEventArgs args);
        public delegate void DataSavedEventHandler(AElement source, ArboriumSavedEventArgs args);

        public delegate void MetaDataLoadingEventHandler(AElement source, ArboriumLoadingEventArgs args);
        public delegate void MetaDataLoadedEventHandler(AElement source, ArboriumLoadedEventArgs args);
        public delegate void MetaDataSavingEventHandler(AElement source, ArboriumSavingEventArgs args);
        public delegate void MetaDataSavedEventHandler(AElement source, ArboriumSavedEventArgs args);

        #endregion

        #region Events

        public static event DataLoadingEventHandler OnDataLoading;
        public static event DataLoadedEventHandler OnDataLoaded;
        public event DataSavingEventHandler OnDataSaving;
        public event DataSavedEventHandler OnDataSaved;

        public static event MetaDataLoadingEventHandler OnMetaDataLoading;
        public static event MetaDataLoadedEventHandler OnMetaDataLoaded;
        public event MetaDataSavingEventHandler OnMetaDataSaving;
        public event MetaDataSavedEventHandler OnMetaDataSaved;

        #endregion
    }
    
    #endregion
}